package com.zwz.service.baseConfig;

import java.util.Map;
import java.util.Set;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zwz.dao.BaseDao;
import com.zwz.dao.SysRolesDao;
import com.zwz.model.SysRoles;
import com.zwz.service.BaseService;

/**
 * @author zhangwanzhong
 * 2016年2月23日 下午2:16:55
 */
@Service
public class SysRoleService extends BaseService<SysRoles> {
	@Autowired
	private SysRolesDao<SysRoles> sysRolesDao;

	@Override
	public BaseDao<SysRoles> getDao() {
		return sysRolesDao;
	}
	
	/**
	 * 根据userId查询roleId
	 * @param userId
	 * @return
	 */
	public Map<String, String> getUserRoleIdByUserId(String userId){
		return sysRolesDao.getUserRoleIdByUserId(userId);
	}
	
	/**
	 * 根据userId查询角色列表
	 * @param userId
	 * @return
	 */
	public Set<String> getAllRoleCode(String userId){
		return sysRolesDao.getAllRoleCode(userId);
	}
	
	/**
	 * 根据url查询角色编码
	 * @param url
	 * @return
	 */
	public Set<String> getRoleCodeByUrl(String url){
		return sysRolesDao.getRoleCodeByUrl(url);
	}
}
